#!/usr/bin/env python
# coding: utf-8

# In[237]:


print(2021);
print("");
y=0;
i=0;
k=0;
loop=0;
j=0;
first = 1;
day = 1;
this=0;
z=0;
y=0;
x=0;
month=[("January",31),("February",28),("March",31),("April",30),("\t May",31),("\t June",30),("July",31),("\t August",31),("September",30),("Octuber",31),("November",30),("December",31)]
for i in range(4):
    loop=0;
    print("\t"+ month[i+y][0] + " \t\t "+ month[i+y+1][0]+" \t\t "+ month[i+y+2][0])
    print("Mo Tu We Th Fr Sa Su \t Mo Tu We Th Fr Sa Su \t Mo Tu We Th Fr Sa Su")
    for k in range(3):
        for j in range(first):
            print("   ", end="");
        a=first;
        for a in range(7-first):
            print(" "+ str(day), end=" ");
            day=day+1;
            if(loop==0):
                one=day;
            elif(loop==1):
                two=day;
            elif(loop==2):
                three=day;
        loop=loop+1;
        print("\t ", end="");
        day=1;
        j=0;
        if(month[this][1]==28):
            first = first;
        elif((month[this][1]%2)==1):
            first = first + 3;
            if(first>6):
                first=first-7;
        elif((month[this][1]%2)==0):
            first = first + 2; 
            if(first>6):
                first=first-7;
        this=this+1;
    for z in range(5):
        loop=0;
        m=3;
        for d in range(3):
            if (loop==0):
                s=one;
                one=one+7
            elif(loop==1):
                s=two;
                two=two+7
            else:
                s=three;
                three=three+7
            for x in range(7):
                if((x==0)and(z==0)and(d==0)):
                    print("");
                if(s<10):
                    print(" "+str(s), end=" ");
                elif(s<=month[this-m][1]):
                    print(str(s), end=" ");
                else:
                    print("  ",end=" ");
                s=s+1;
            m=m-1;
            loop=loop+1;
            print("\t",end=" ");
        print("\t") 
    print("\n")
    y=y+2;


# In[ ]:





# In[ ]:




